<?php
/**
* @file $Id: FixGPA.php 161 2006-09-07 06:21:17Z doritojones $
* @package Focus/SIS
* @copyright Copyright (C) 2006 Andrew Schmadeke. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* Focus/SIS is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.txt for copyright notices and details.
*/

DrawHeader(ProgramTitle());

$mps = GetAllMP('PRO',UserMP());
$mps = explode(',',str_replace("'",'',$mps));
$message = '<TABLE><TR><TD colspan=7 align=center>';
foreach($mps as $mp)
{
	if($mp && $mp!='0')
		$message .= '<INPUT type=radio name=marking_period_id value='.$mp.($mp==UserMP()?' CHECKED':'').'>'.GetMP($mp).'<BR>';
}

$message .= '</TD></TR></TABLE>';
if(Prompt('Confirm',_('When do you want to recalculate the running GPA numbers?'),$message))
{	
	$students_RET = GetStuList($extra);

	foreach($students_RET as $student)
	{
		CalcGPA($student['STUDENT_ID'],$_REQUEST['marking_period_id']);
	}

	unset($_REQUEST['modfunc']);
	DrawHeader('<IMG SRC=assets/check.gif> '._('The grades for that marking period has been recalculated.'));
}

?>